package com.jy.wms.service;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.jy.wms.common.annotions.BaseServiceDescribe;
import com.jy.wms.common.base.BaseService;
import com.jy.wms.common.base.PinyinTools;
import com.jy.wms.dao.WmsGoodsMapper;
import com.jy.wms.dao.WmsOrderReportMapper;
import com.jy.wms.pojo.WmsGoods;
import com.jy.wms.pojo.WmsGoodsType;
import com.jy.wms.pojo.WmsOrderReport;
import org.apache.commons.collections.map.HashedMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.*;

/**
 * @ClassName: UserController
 * @Description: TODO(这里用一句话描述这个类的作用)
 * @Author lh
 * @Date 2018/3/21 0021
 */
@Service
public class WmsOrderReportService extends BaseService<WmsOrderReportMapper,WmsOrderReport> {
    @Autowired
    WmsOrderReportMapper wmsOrderReportMapper;
    @Autowired
    WmsGoodsMapper wmsGoodsMapper;
    /**
     * 已发货订单产品数量各地区分布比例  分页查询
     *
     * @param
     * @return Page<WmsArtificialReplenishment>
     */
    @BaseServiceDescribe(moduleName = "发货量报表查询", btnName = "分页查询")
    public List<Map> baseSelectPage(Map maps) {
        PageHelper.startPage(Integer.parseInt(maps.get("page").toString()), Integer.parseInt(maps.get("rows").toString()));
        //查询所有货品
        List<WmsGoods> goodList = dao.getAllGoods(maps.get("ckid").toString(),maps);
        PageHelper.startPage(Integer.parseInt(maps.get("page").toString()), Integer.parseInt(maps.get("rows").toString()));
        List<String> hpid = dao.getAllHpid(maps.get("ckid").toString(),maps);
        //查询最后一行的合计行(同一个省的所有货品的所有发运数量的和，按省分类)
        List<WmsOrderReport> totallist=dao.getOrderProductTotal(maps,hpid);
        List<Map>listMap =new ArrayList<Map>();
        PinyinTools pinyinTools=new PinyinTools();
        for (WmsGoods wmsGoods : goodList) {
            Map map=new HashedMap();
            //根据货品id查询这个货品在每个省的发运数量及在所有省的占比
            List<WmsOrderReport> list = dao.getOrderProductCount(wmsGoods.getId(),maps);
            if (list.size() > 0) {
                for (WmsOrderReport wor : list) {
                    if(wor.getSheng().equals("陕西省")){
                        map.put(pinyinTools.toHanyuPinyin(wor.getSheng())+"sl1",wor.getNum());
                        //map.put(pinyinTools.toHanyuPinyin(wor.getSheng())+"bl1",wor.getRatio());
                    }else{
                        map.put(pinyinTools.toHanyuPinyin(wor.getSheng())+"sl",wor.getNum());
                      //  map.put(pinyinTools.toHanyuPinyin(wor.getSheng())+"bl",wor.getRatio());
                    }
                    map.put("cjsj",wor.getCjsj());
                    map.put("total",wor.getTotal());
                }

            }

            map.put("hpid",wmsGoods.getId());//货品id
            map.put("hpmc",wmsGoods.getMc());
            map.put("type",wmsGoods.getType());
            map.put("bh",wmsGoods.getBh());
            map.put("nc",wmsGoods.getNc());
            map.put("gg",wmsGoods.getGg());//规格
            map.put("dw",wmsGoods.getMs());//单位
            map.put("dj",wmsGoods.getJe());//单价
            listMap.add(map);
        }

        //按总计排序
        Collections.sort(listMap, new Comparator<Map>() {
            @Override
            public int compare(Map o1, Map o2) {
                //进行判断
                if(o2.get("total")==null){
                    o2.put("total",0);
                }
                if(o1.get("total")==null){
                    o1.put("total",0);
                }
                return ( (Double.valueOf(o2.get("total").toString())).compareTo(Double.valueOf(o1.get("total").toString())) );
            }
        });

        Map map2=new HashedMap();
       String totalSum=dao.getTotalSum(maps,hpid);
        for(WmsOrderReport wmsOrderReport1:totallist){
            if(wmsOrderReport1.getSheng().equals("陕西省")){
                map2.put(pinyinTools.toHanyuPinyin(wmsOrderReport1.getSheng())+"sl1",wmsOrderReport1.getNum());
             //   map2.put(pinyinTools.toHanyuPinyin(wmsOrderReport1.getSheng())+"bl1",wmsOrderReport1.getRatio());
            }else{
                map2.put(pinyinTools.toHanyuPinyin(wmsOrderReport1.getSheng())+"sl",wmsOrderReport1.getNum());
              //  map2.put(pinyinTools.toHanyuPinyin(wmsOrderReport1.getSheng())+"bl",wmsOrderReport1.getRatio());
            }
        }
        map2.put("total",totalSum);
        map2.put("hpmc","总计");
        listMap.add(map2);



        return listMap;
    }

     /**
     * 查询总条数
     * @param maps 查询条件
     * @return
     */
     @BaseServiceDescribe(moduleName = "发货量报表查询总条数", btnName = "分页查询")
    public int getAllGoodsCount(Map maps) {
        return dao.getAllGoodsCount(maps.get("ckid").toString(),maps);
    }



    /**
     *  已发货订单产品数量各地区分布比例   定时器生成数据存放在数据库
     *
     * @param
     * @return Page<WmsArtificialReplenishment>
     */
   /* public List<Map> generateOrderProductCount(WmsOrderReport wmsOrderReport) {
       // PageHelper.startPage(wmsOrderReport.getPage(), wmsOrderReport.getRows());
        //查询所有货品
        List<WmsGoods> goodList = dao.getAllGoods(wmsOrderReport.getCkid());
        List<String> hpid = dao.getAllHpid(wmsOrderReport.getCkid(),wmsOrderReport.getPage(),wmsOrderReport.getRows());
        //查询最后一行的合计行(同一个省的所有货品的所有发运数量的和，按省分类)
        List<WmsOrderReport> totallist=dao.getOrderProductTotal2(wmsOrderReport,hpid);
        List<Map>listMap =new ArrayList<Map>();
        PinyinTools pinyinTools=new PinyinTools();
        for (WmsGoods wmsGoods : goodList) {
            Map map=new HashedMap();
            //根据货品id查询这个货品在每个省的发运数量及在所有省的占比
            List<WmsOrderReport> list = dao.getOrderProductCount2(wmsGoods.getId(),wmsOrderReport);
            if (list.size() > 0) {
                for (WmsOrderReport wor : list) {
                    if(wor.getSheng().equals("陕西省")){
                        map.put(pinyinTools.toHanyuPinyin(wor.getSheng())+"sl1",wor.getNum());
                        map.put(pinyinTools.toHanyuPinyin(wor.getSheng())+"bl1",wor.getRatio());
                    }else{
                        map.put(pinyinTools.toHanyuPinyin(wor.getSheng())+"sl",wor.getNum());
                        map.put(pinyinTools.toHanyuPinyin(wor.getSheng())+"bl",wor.getRatio());
                    }
                    map.put("total",wor.getTotal());
                }
                map.put("hpmc",wmsGoods.getMc());
                map.put("ckid",wmsGoods.getCkid());
                listMap.add(map);
            }
        }
       *//* Map map2=new HashedMap();

        for(WmsOrderReport wmsOrderReport1:totallist){

            if(wmsOrderReport1.getSheng().equals("陕西省")){
                map2.put(pinyinTools.toHanyuPinyin(wmsOrderReport1.getSheng())+"sl1",wmsOrderReport1.getNum());
                map2.put(pinyinTools.toHanyuPinyin(wmsOrderReport1.getSheng())+"bl1",wmsOrderReport1.getRatio());
            }else{
                map2.put(pinyinTools.toHanyuPinyin(wmsOrderReport1.getSheng())+"sl",wmsOrderReport1.getNum());
                map2.put(pinyinTools.toHanyuPinyin(wmsOrderReport1.getSheng())+"bl",wmsOrderReport1.getRatio());
            }
        }
        String totalSum=dao.getTotalSum2(wmsOrderReport,hpid);

        map2.put("total",totalSum);
        map2.put("hpmc","总计");

        listMap.add(map2);
          *//*
        return listMap;
    }

*/



    /**
     * 导出
     *
     * @param
     * @return Page<WmsArtificialReplenishment>
     */
    @BaseServiceDescribe(moduleName = "发货量报表导出", btnName = "导出")
    public List<Map> getOutPutList(List<String> ids,Map maps) {
       // PageHelper.startPage(wmsOrderReport.getPage(), wmsOrderReport.getRows());
        //查询所有货品
        //List<WmsGoods> goodList = dao.getAllGoods(wmsOrderReport.getCkid());
        List<WmsGoods>goodList=null;
        if(ids!=null && ids.size()>0){
            goodList=  wmsGoodsMapper.selectBatchIds(ids);
        }else {
            goodList = dao.getAllGoods((String)maps.get("ckid"),maps);
        }

        //List<String> hpids = dao.getAllHpid(wmsOrderReport.getCkid(),wmsOrderReport.getPage(),wmsOrderReport.getRows());
        //查询最后一行的合计行(同一个省的所有货品的所有发运数量的和，按省分类)
        List<WmsOrderReport> totallist=dao.getOrderProductTotal(maps,ids);
        List<Map>listMap =new ArrayList<Map>();
        PinyinTools pinyinTools=new PinyinTools();
        for (WmsGoods wmsGoods : goodList) {
            Map map=new HashedMap();
            //根据货品id查询这个货品在每个省的发运数量及在所有省的占比
            List<WmsOrderReport> list = dao.getOrderProductCount(wmsGoods.getId(),maps);
            if (list.size() > 0) {
                for (WmsOrderReport wor : list) {
                    if(wor.getSheng().equals("陕西省")){
                        map.put(pinyinTools.toHanyuPinyin(wor.getSheng())+"sl1",wor.getNum());
                       // map.put(pinyinTools.toHanyuPinyin(wor.getSheng())+"bl1",wor.getRatio());
                    }else{
                        map.put(pinyinTools.toHanyuPinyin(wor.getSheng())+"sl",wor.getNum());
                        //map.put(pinyinTools.toHanyuPinyin(wor.getSheng())+"bl",wor.getRatio());
                    }
                    map.put("cjsj",wor.getCjsj());
                    map.put("total",wor.getTotal());
                }

            }
            map.put("hpid",wmsGoods.getId());//货品id
            map.put("hpmc",wmsGoods.getMc());
            map.put("type",wmsGoods.getType());
            map.put("bh",wmsGoods.getBh());
            map.put("nc",wmsGoods.getNc());
            map.put("gg",wmsGoods.getGg());//规格
            map.put("dw",wmsGoods.getMs());//单位
            map.put("dj",wmsGoods.getJe());//单价
            listMap.add(map);

        }

        //按总计排序
        Collections.sort(listMap, new Comparator<Map>() {
            @Override
            public int compare(Map o1, Map o2) {
                //进行判断
                if(o2.get("total")==null){
                    o2.put("total",0);
                }
                if(o1.get("total")==null){
                    o1.put("total",0);
                }
                return ( (Double.valueOf(o2.get("total").toString())).compareTo(Double.valueOf(o1.get("total").toString())) );
            }
        });

        Map map2=new HashedMap();
        String totalSum=dao.getTotalSum(maps,ids);
        for(WmsOrderReport wmsOrderReport1:totallist){
            if(wmsOrderReport1.getSheng().equals("陕西省")){
                map2.put(pinyinTools.toHanyuPinyin(wmsOrderReport1.getSheng())+"sl1",wmsOrderReport1.getNum());
                //map2.put(pinyinTools.toHanyuPinyin(wmsOrderReport1.getSheng())+"bl1",wmsOrderReport1.getRatio());
            }else{
                map2.put(pinyinTools.toHanyuPinyin(wmsOrderReport1.getSheng())+"sl",wmsOrderReport1.getNum());
               // map2.put(pinyinTools.toHanyuPinyin(wmsOrderReport1.getSheng())+"bl",wmsOrderReport1.getRatio());
            }
        }
        map2.put("total",totalSum);
        map2.put("hpmc","总计");
        listMap.add(map2);
        return listMap;
    }







    /**
     * 已发货订单产品销售额各地区分布比例  分页查询
     *
     * @param
     * @return Page<WmsArtificialReplenishment>
     */
    @BaseServiceDescribe(moduleName = "发货产品销售额查询", btnName = "分页查询")
    public List<Map> getSaleMoney( Map maps) {
        PageHelper.startPage(Integer.parseInt(maps.get("page").toString()), Integer.parseInt(maps.get("rows").toString()));
        //查询所有货品
        List<WmsGoods> goodList = dao.getAllGoods(maps.get("ckid").toString(),maps);
        PageHelper.startPage(Integer.parseInt(maps.get("page").toString()), Integer.parseInt(maps.get("rows").toString()));
        List<String> hpid = dao.getAllHpid(maps.get("ckid").toString(),maps);
        //查询最后一行的合计行(同一个省的所有货品的所有发运数量的和，按省分类)
        List<WmsOrderReport> totallist=dao.getSaleMoneyTotal(maps,hpid);
        List<Map>listMap =new ArrayList<Map>();
        PinyinTools pinyinTools=new PinyinTools();
        for (WmsGoods wmsGoods : goodList) {
            Map map=new HashedMap();
            //根据货品id查询这个货品在每个省的发运数量及在所有省的占比
            List<WmsOrderReport> list = dao.getSaleMoney(wmsGoods.getId(),maps);
            if (list.size() > 0) {
                for (WmsOrderReport wor : list) {
                    if (wor.getSheng().equals("陕西省")) {
                        map.put(pinyinTools.toHanyuPinyin(wor.getSheng()) + "sl1", wor.getNum());
                        //map.put(pinyinTools.toHanyuPinyin(wor.getSheng())+"bl1",wor.getRatio());
                    } else {
                        map.put(pinyinTools.toHanyuPinyin(wor.getSheng()) + "sl", wor.getNum());
                        //  map.put(pinyinTools.toHanyuPinyin(wor.getSheng())+"bl",wor.getRatio());
                    }
                    map.put("cjsj", wor.getCjsj());
                    map.put("total", wor.getTotal());
                }

            }
            map.put("hpid",wmsGoods.getId());//货品id
            map.put("hpmc",wmsGoods.getMc());
            map.put("type",wmsGoods.getType());
            map.put("bh",wmsGoods.getBh());
            map.put("nc",wmsGoods.getNc());
            map.put("gg",wmsGoods.getGg());//规格
            map.put("dw",wmsGoods.getMs());//单位
            map.put("dj",wmsGoods.getJe());//单价
            listMap.add(map);
            }
        //按总计排序
        Collections.sort(listMap, new Comparator<Map>() {
            @Override
            public int compare(Map o1, Map o2) {
                //进行判断
                if(o2.get("total")==null){
                    o2.put("total",0);
                }
                if(o1.get("total")==null){
                    o1.put("total",0);
                }
                return ( (Double.valueOf(o2.get("total").toString())).compareTo(Double.valueOf(o1.get("total").toString())) );
            }
        });

        Map map2=new HashedMap();
        String totalSum=dao.getSaleMoneyTotalSum(maps,hpid);
        for(WmsOrderReport wmsOrderReport1:totallist){
            if(wmsOrderReport1.getSheng().equals("陕西省")){
                map2.put(pinyinTools.toHanyuPinyin(wmsOrderReport1.getSheng())+"sl1",wmsOrderReport1.getNum());
            }else{
                map2.put(pinyinTools.toHanyuPinyin(wmsOrderReport1.getSheng())+"sl",wmsOrderReport1.getNum());
            }
        }
        map2.put("total",totalSum);
        map2.put("hpmc","总计");
        listMap.add(map2);
        return listMap;
    }




    /**
     * 已发货订单产品销售额各地区分布比例   导出
     *
     * @param
     * @return Page<WmsArtificialReplenishment>
     */
    @BaseServiceDescribe(moduleName = "发货产品销售额导出", btnName = "发货产品销售额导出")
    public List<Map> saleMoneyOutPut(List<String> ids,Map maps) {
        // PageHelper.startPage(wmsOrderReport.getPage(), wmsOrderReport.getRows());
        //查询所有货品
        //List<WmsGoods> goodList = dao.getAllGoods(wmsOrderReport.getCkid());
        List<WmsGoods>goodList=null;
        if(ids!=null && ids.size()>0){
            goodList=  wmsGoodsMapper.selectBatchIds(ids);
        }else {
            goodList = dao.getAllGoods((String)maps.get("ckid"),maps);
        }
        //List<String> hpids = dao.getAllHpid(wmsOrderReport.getCkid(),wmsOrderReport.getPage(),wmsOrderReport.getRows());
        //查询最后一行的合计行(同一个省的所有货品的所有发运数量的和，按省分类)
        List<WmsOrderReport> totallist=dao.getSaleMoneyTotal(maps,ids);
        List<Map>listMap =new ArrayList<Map>();
        PinyinTools pinyinTools=new PinyinTools();
        for (WmsGoods wmsGoods : goodList) {
            Map map=new HashedMap();
            //根据货品id查询这个货品在每个省的发运数量及在所有省的占比
            List<WmsOrderReport> list = dao.getSaleMoney(wmsGoods.getId(),maps);
            if (list.size() > 0) {
                for (WmsOrderReport wor : list) {
                    if(wor.getSheng().equals("陕西省")){
                        map.put(pinyinTools.toHanyuPinyin(wor.getSheng())+"sl1",wor.getNum());
                       // map.put(pinyinTools.toHanyuPinyin(wor.getSheng())+"bl1",wor.getRatio());
                    }else{
                        map.put(pinyinTools.toHanyuPinyin(wor.getSheng())+"sl",wor.getNum());
                       // map.put(pinyinTools.toHanyuPinyin(wor.getSheng())+"bl",wor.getRatio());
                    }
                    map.put("cjsj",wor.getCjsj());
                    map.put("total",wor.getTotal());
                }

            }

            map.put("hpid",wmsGoods.getId());//货品id
            map.put("hpmc",wmsGoods.getMc());
            map.put("type",wmsGoods.getType());
            map.put("bh",wmsGoods.getBh());
            map.put("nc",wmsGoods.getNc());
            map.put("gg",wmsGoods.getGg());//规格
            map.put("dw",wmsGoods.getMs());//单位
            map.put("dj",wmsGoods.getJe());//单价
            listMap.add(map);

        }

        //按总计排序
        Collections.sort(listMap, new Comparator<Map>() {
            @Override
            public int compare(Map o1, Map o2) {
                //进行判断
                if(o2.get("total")==null){
                    o2.put("total",0);
                }
                if(o1.get("total")==null){
                    o1.put("total",0);
                }
                return ( (Double.valueOf(o2.get("total").toString())).compareTo(Double.valueOf(o1.get("total").toString())) );
            }
        });
        Map map2=new HashedMap();
        String totalSum=dao.getSaleMoneyTotalSum(maps,ids);
        for(WmsOrderReport wmsOrderReport1:totallist){
            if(wmsOrderReport1.getSheng().equals("陕西省")){
                map2.put(pinyinTools.toHanyuPinyin(wmsOrderReport1.getSheng())+"sl1",wmsOrderReport1.getNum());
               // map2.put(pinyinTools.toHanyuPinyin(wmsOrderReport1.getSheng())+"bl1",wmsOrderReport1.getRatio());
            }else{
                map2.put(pinyinTools.toHanyuPinyin(wmsOrderReport1.getSheng())+"sl",wmsOrderReport1.getNum());
               // map2.put(pinyinTools.toHanyuPinyin(wmsOrderReport1.getSheng())+"bl",wmsOrderReport1.getRatio());
            }
        }
        map2.put("total",totalSum);
        map2.put("hpmc","总计");
        listMap.add(map2);
        return listMap;
    }























                                /*已发货订单产品销售额各地区分布比例（分类）*/


    /**
     * 分页查询
     *
     * @param
     * @return Page<WmsArtificialReplenishment>
     */
     public List<Map> getOrderProductTotal(WmsOrderReport wmsOrderReport) {
        PageHelper.startPage(wmsOrderReport.getPage(), wmsOrderReport.getRows());
        //查询所有货品
        List<WmsGoodsType> typeList = dao.getAllGoodsType(wmsOrderReport.getCkid());
        List<String> typeIds = dao.getAllTypeIds(wmsOrderReport.getCkid(),wmsOrderReport.getPage(),wmsOrderReport.getRows());
        //查询最后一行的合计行(同一个省的所有货品的所有发运数量的和，按省分类)
        List<WmsOrderReport> totallist=dao.getProductMoneyTotal(wmsOrderReport,typeIds);
        List<Map>listMap =new ArrayList<Map>();
        PinyinTools pinyinTools=new PinyinTools();
        for (WmsGoodsType wmsGoodsType : typeList) {
            Map map=new HashedMap();
            //根据货品种类id查询这个货品种类下的所有货品在每个省的发运数量和及在所有省的占比
            List<WmsOrderReport> list =   dao.getProductMoney(wmsGoodsType.getId(),wmsOrderReport);
            if (list.size() > 0) {
                for (WmsOrderReport wor : list) {
                    if(wor.getSheng().equals("陕西省")){
                        map.put(pinyinTools.toHanyuPinyin(wor.getSheng())+"sl1",wor.getNum());
                        map.put(pinyinTools.toHanyuPinyin(wor.getSheng())+"bl1",wor.getRatio());
                    }else{
                        map.put(pinyinTools.toHanyuPinyin(wor.getSheng())+"sl",wor.getNum());
                        map.put(pinyinTools.toHanyuPinyin(wor.getSheng())+"bl",wor.getRatio());
                    }
                    map.put("total",wor.getTotal());
                }
                map.put("hpzl",wmsGoodsType.getMc());
                listMap.add(map);
            }
        }
        Map map2=new HashedMap();
        String totalSum=dao.getMoneyTotalSum(wmsOrderReport,typeIds);
        for(WmsOrderReport wmsOrderReport1:totallist){
            if(wmsOrderReport1.getSheng().equals("陕西省")){
                map2.put(pinyinTools.toHanyuPinyin(wmsOrderReport1.getSheng())+"sl1",wmsOrderReport1.getNum());
                map2.put(pinyinTools.toHanyuPinyin(wmsOrderReport1.getSheng())+"bl1",wmsOrderReport1.getRatio());
            }else{
                map2.put(pinyinTools.toHanyuPinyin(wmsOrderReport1.getSheng())+"sl",wmsOrderReport1.getNum());
                map2.put(pinyinTools.toHanyuPinyin(wmsOrderReport1.getSheng())+"bl",wmsOrderReport1.getRatio());
            }
        }
        map2.put("total",totalSum);
        map2.put("hpmc","总计");
        listMap.add(map2);
        return listMap;
    }




    /**
     * 导出
     *
     * @param
     * @return Page<WmsArtificialReplenishment>
     */
    public List<Map> getOutPutListMoney(WmsOrderReport wmsOrderReport) {
      //  PageHelper.startPage(wmsOrderReport.getPage(), wmsOrderReport.getRows());
        //查询所有货品
        List<WmsGoodsType> typeList = dao.getAllGoodsType(wmsOrderReport.getCkid());
       // List<String> typeIds = dao.getAllTypeIds(wmsOrderReport.getCkid(),wmsOrderReport.getPage(),wmsOrderReport.getRows());
        //查询最后一行的合计行(同一个省的所有货品的所有发运数量的和，按省分类)
        List<WmsOrderReport> totallist=dao.getProductMoneyTotal(wmsOrderReport,null);
        List<Map>listMap =new ArrayList<Map>();
        PinyinTools pinyinTools=new PinyinTools();
        for (WmsGoodsType wmsGoodsType : typeList) {
            Map map=new HashedMap();
            //根据货品种类id查询这个货品种类下的所有货品在每个省的发运数量和及在所有省的占比
            List<WmsOrderReport> list =   dao.getProductMoney(wmsGoodsType.getId(),wmsOrderReport);
            if (list.size() > 0) {
                for (WmsOrderReport wor : list) {
                    if(wor.getSheng().equals("陕西省")){
                        map.put(pinyinTools.toHanyuPinyin(wor.getSheng())+"sl1",wor.getNum());
                        map.put(pinyinTools.toHanyuPinyin(wor.getSheng())+"bl1",wor.getRatio());
                    }else{
                        map.put(pinyinTools.toHanyuPinyin(wor.getSheng())+"sl",wor.getNum());
                        map.put(pinyinTools.toHanyuPinyin(wor.getSheng())+"bl",wor.getRatio());
                    }
                    map.put("total",wor.getTotal());
                }
                map.put("hpzl",wmsGoodsType.getMc());
                listMap.add(map);
            }
        }
        Map map2=new HashedMap();
        String totalSum=dao.getMoneyTotalSum(wmsOrderReport,null);
        for(WmsOrderReport wmsOrderReport1:totallist){
            if(wmsOrderReport1.getSheng().equals("陕西省")){
                map2.put(pinyinTools.toHanyuPinyin(wmsOrderReport1.getSheng())+"sl1",wmsOrderReport1.getNum());
                map2.put(pinyinTools.toHanyuPinyin(wmsOrderReport1.getSheng())+"bl1",wmsOrderReport1.getRatio());
            }else{
                map2.put(pinyinTools.toHanyuPinyin(wmsOrderReport1.getSheng())+"sl",wmsOrderReport1.getNum());
                map2.put(pinyinTools.toHanyuPinyin(wmsOrderReport1.getSheng())+"bl",wmsOrderReport1.getRatio());
            }
        }
        map2.put("total",totalSum);
        map2.put("hpmc","总计");
        listMap.add(map2);
        return listMap;
    }




}
